/*
 * @Descripttion: GGB
 * @version: 1.0
 * @Author: GGB
 * @Date: 2021-08-17 16:07:53
 * @LastEditors: GGB
 * @LastEditTime: 2021-08-17 16:22:37
 */
import 'package:flutter/material.dart';
import 'package:flutter_data_center/components/dotted_line.dart';
import 'package:flutter_data_center/components/loading.dart';
import 'package:flutter_data_center/controller/door_controller.dart';
import 'package:get/get.dart';

import 'door_detail_item.dart';

class DoorDetailList extends StatelessWidget {
  const DoorDetailList({Key key}) : super(key: key);

  @override
  Widget build(BuildContext context) => GetBuilder<DoorController>(
        builder: (_controller) => _controller.peopleList.length > 0
            ? ListView.separated(
                physics: BouncingScrollPhysics(),
                itemBuilder: (BuildContext context, int index) =>
                    DoorDetailItem(
                  person: _controller.peopleList[index],
                ),
                separatorBuilder: (BuildContext context, int index) {
                  return Padding(
                    padding: const EdgeInsets.symmetric(horizontal: 15),
                    child: DottedLine(
                      height: 0.5,
                      width: 0.5,
                      circle: true,
                      margin: 1,
                    ),
                  );
                },
                itemCount: _controller.peopleList.length,
              )
            : Loading(),
      );
}
